FROM eclipse-temurin:21.0.4_7-jdk-jammy

LABEL author="baihongru"

# 时区设置
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' > /etc/timezone

ENV JAR_NAME=ruoyi-admin.jar
ENV WORK_DIR=/home/ruoyi

RUN mkdir -p ${WORK_DIR} && mkdir ${WORK_DIR}/logs && mkdir ${WORK_DIR}/uploadPath
COPY ./package/${JAR_NAME} ${WORK_DIR}

WORKDIR ${WORK_DIR}

ENTRYPOINT ["sh", "-ec", "exec java ${JAVA_OPTS} -jar ${JAR_NAME}"]
